package string;

/**
 * @Author: Miyako
 * @Date: 2024-07-12-9:42
 * @Description:
 */
public class StringBuilderDemo {
    public static void main(String[] args) {
        String s= "Hello";
        StringBuilder sb = new StringBuilder(s);
        sb.append("，word");
        System.out.println(sb);
        String string = sb.toString();
        System.out.println(string);
        sb.replace(0,2,"hi");
        System.out.println(sb);
        sb.delete(0,2);
        System.out.println(sb);
        sb.insert(0,"hi");
        System.out.println(sb);
    }
}
